<template>
    <div>
        <ul>
            <li v-for="item in data"
                :key="item.id"
                @click="gradeCheck(item.id)"
                :class="{'change':item.id === course_type}"
            >{{item.name}}
            </li>
        </ul>
    </div>
</template>

<script>
    export default {
        name: "Screen",
        props: {},
        computed: {
            course_type() {
                console.log('1234',this.$store.state)
                return this.$store.state.course.course_type
            }
        },
        data() {
            return {
                data: [
                    {name: '全部', id: 1},
                    {name: '大班课', id: 2},
                    {name: '小班', id: 3},
                    {name: '公开课', id: 4},
                    {name: '点播课', id: 5},
                    {name: '面授课', id: 7},
                    {name: '音频课', id: 8},
                    {name: '系统课', id: 9},
                    {name: '图文课', id: 10},
                    {name: '会员课', id: 0}
                ]
            }
        },
        mounted() {
        },
        methods: {
            gradeCheck(index) {
                this.$store.commit('gradeCheck', index)
                this.$emit('cde')
            }
        },
        filters: {},
        watch: {}
    }
</script>

<style scoped lang="scss">
    ul {
        width: 90%;
        margin: 10px auto;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;


        li {
            font-size: 30px;
            width: 180px;
            line-height: 60px;
            text-align: center;
            background-color: rgba(238, 238, 238, 0.84);
            margin: 10px 20px;
            color: #6c757d;
            border-radius: 5px;

            &.change {
                background-color: #EBEEFE;
                color: #EB6100;
            }
        }
    }
</style>